/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

/**
 *
 * @author Human Booster
 */
@Entity
@Table(name = "licencecustomer")
@NamedQueries({
    @NamedQuery(name = "Licencecustomer.findAll", query = "SELECT l FROM Licencecustomer l"),
    @NamedQuery(name = "Licencecustomer.findById", query = "SELECT l FROM Licencecustomer l WHERE l.licencecustomerPK.id = :id"),
    @NamedQuery(name = "Licencecustomer.findByCreationDate", query = "SELECT l FROM Licencecustomer l WHERE l.creationDate = :creationDate"),
    @NamedQuery(name = "Licencecustomer.findByLicenceSoftwareid", query = "SELECT l FROM Licencecustomer l WHERE l.licencecustomerPK.licenceSoftwareid = :licenceSoftwareid"),
    @NamedQuery(name = "Licencecustomer.findByLicenceSoftwareLifeTimeid", query = "SELECT l FROM Licencecustomer l WHERE l.licencecustomerPK.licenceSoftwareLifeTimeid = :licenceSoftwareLifeTimeid"),
    @NamedQuery(name = "Licencecustomer.findByLicenceSoftwareSoftwareid", query = "SELECT l FROM Licencecustomer l WHERE l.licencecustomerPK.licenceSoftwareSoftwareid = :licenceSoftwareSoftwareid"),
    @NamedQuery(name = "Licencecustomer.findByLicenceSoftwareLicenceCounterLimitid", query = "SELECT l FROM Licencecustomer l WHERE l.licencecustomerPK.licenceSoftwareLicenceCounterLimitid = :licenceSoftwareLicenceCounterLimitid"),
    @NamedQuery(name = "Licencecustomer.findByCustomerOrderid", query = "SELECT l FROM Licencecustomer l WHERE l.licencecustomerPK.customerOrderid = :customerOrderid"),
    @NamedQuery(name = "Licencecustomer.findByCustomerid", query = "SELECT l FROM Licencecustomer l WHERE l.licencecustomerPK.customerid = :customerid"),
    @NamedQuery(name = "Licencecustomer.findByLicenceCustomerCounter", query = "SELECT l FROM Licencecustomer l WHERE l.licenceCustomerCounter = :licenceCustomerCounter"),
    @NamedQuery(name = "Licencecustomer.findByLicenceSerial", query = "SELECT l FROM Licencecustomer l WHERE l.licenceSerial = :licenceSerial")})
public class Licencecustomer implements Serializable {
    @Basic(optional = false)
    @Column(name = "creationDate", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date creationDate;
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected LicencecustomerPK licencecustomerPK;
    @Basic(optional = false)
    @Column(name = "LicenceCustomerCounter")
    private int licenceCustomerCounter;
    @Basic(optional = false)
    @Column(name = "LicenceSerial")
    private String licenceSerial;
    @JoinColumns({
        @JoinColumn(name = "CustomerOrder_id", referencedColumnName = "id", insertable = false, updatable = false),
        @JoinColumn(name = "Customer_id", referencedColumnName = "Customer_id", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Customerorder customerorder;
    @JoinColumns({
        @JoinColumn(name = "LicenceSoftware_id", referencedColumnName = "id", insertable = false, updatable = false),
        @JoinColumn(name = "LicenceSoftware_LifeTime_id", referencedColumnName = "LifeTime_id", insertable = false, updatable = false),
        @JoinColumn(name = "LicenceSoftware_Software_id", referencedColumnName = "Software_id", insertable = false, updatable = false),
        @JoinColumn(name = "LicenceSoftware_LicenceCounterLimit_id", referencedColumnName = "LicenceCounterLimit_id", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Licencesoftware licencesoftware;

    public Licencecustomer() {
    }

    public Licencecustomer(LicencecustomerPK licencecustomerPK) {
        this.licencecustomerPK = licencecustomerPK;
    }

    public Licencecustomer(LicencecustomerPK licencecustomerPK, Date creationDate, int licenceCustomerCounter, String licenceSerial) {
        this.licencecustomerPK = licencecustomerPK;
        this.creationDate = creationDate;
        this.licenceCustomerCounter = licenceCustomerCounter;
        this.licenceSerial = licenceSerial;
    }

    public Licencecustomer(int id, int licenceSoftwareid, int licenceSoftwareLifeTimeid, int licenceSoftwareSoftwareid, int licenceSoftwareLicenceCounterLimitid, int customerOrderid, int customerid) {
        this.licencecustomerPK = new LicencecustomerPK(id, licenceSoftwareid, licenceSoftwareLifeTimeid, licenceSoftwareSoftwareid, licenceSoftwareLicenceCounterLimitid, customerOrderid, customerid);
    }

    public LicencecustomerPK getLicencecustomerPK() {
        return licencecustomerPK;
    }

    public void setLicencecustomerPK(LicencecustomerPK licencecustomerPK) {
        this.licencecustomerPK = licencecustomerPK;
    }

    public int getLicenceCustomerCounter() {
        return licenceCustomerCounter;
    }

    public void setLicenceCustomerCounter(int licenceCustomerCounter) {
        this.licenceCustomerCounter = licenceCustomerCounter;
    }

    public String getLicenceSerial() {
        return licenceSerial;
    }

    public void setLicenceSerial(String licenceSerial) {
        this.licenceSerial = licenceSerial;
    }

    public Customerorder getCustomerorder() {
        return customerorder;
    }

    public void setCustomerorder(Customerorder customerorder) {
        this.customerorder = customerorder;
    }

    public Licencesoftware getLicencesoftware() {
        return licencesoftware;
    }

    public void setLicencesoftware(Licencesoftware licencesoftware) {
        this.licencesoftware = licencesoftware;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (licencecustomerPK != null ? licencecustomerPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Licencecustomer)) {
            return false;
        }
        Licencecustomer other = (Licencecustomer) object;
        if ((this.licencecustomerPK == null && other.licencecustomerPK != null) || (this.licencecustomerPK != null && !this.licencecustomerPK.equals(other.licencecustomerPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Licencecustomer[ licencecustomerPK=" + licencecustomerPK + " ]";
    }

    public Date getCreationDate() {
        return creationDate;
    }

    public void setCreationDate(Date creationDate) {
        this.creationDate = creationDate;
    }
    
}
